import typescript from '@rollup/plugin-typescript';
import commonjs from '@rollup/plugin-commonjs';
import { nodeResolve } from '@rollup/plugin-node-resolve';
export default {
  input: 'src/main.ts',
  output: [
    {
      // file: 'main.mjs',
      format: 'es',
      dir: 'dist',
      entryFileNames: '[name].mjs',
    },
    {
      // file: 'main.cjs',
      format: 'cjs',
      dir: 'dist',
      entryFileNames: '[name].cjs',
    },
    {
      // file: 'main.cjs',
      name: 'myDataDB',
      format: 'iife',
      dir: 'dist',
      entryFileNames: '[name].js',
    },
  ],
  plugins: [
    typescript(),
    nodeResolve(),
    commonjs({
      // ignore: ['conditional-runtime-dependency'],
    }),
  ],
  external: ['dexie'],
};
